<?php
class Zend_View_Helper_MailUsers extends Zend_View_Helper_Abstract {
	
    public $view;
    
    public function setView(Zend_View_Interface $view) {
        $this->view = $view;
    }
    
	public function mailUsers($thread, $loggedInUser) {
//		$targetUsers =  $message->targetUsers;
//		$sendUser = $message->sendUser;
		$index=0;
		foreach($thread->getUsers() as $user) {
			if ($user->id != $loggedInUser->id) {
				$targetUserNames[$index++] = "<a href='".$this->view->url(array('controller'=>'user', "action"=>"profile", "uid"=>$user->id), null, true)."'>".$user->name."</a>";
			}
		}
		$users="Between ".implode(" , ",$targetUserNames)." and <a href='".$this->view->url(array('controller'=>'user', "action"=>"profile", "uid"=>$loggedInUser->id), null, true)."'>You</a>";
		return $users;
	}
}
?>